import request from '@/utils/request'

//获取材料列表信息
export function listMaterial(query) {
  return request({
    url: '/sale/delivery/material/list',
    method: "get",
    params: query
  })
}

// 查询月计划配送单列表
export function listDelivery(query) {
  return request({
    url: '/sale/delivery/list',
    method: 'get',
    params: query
  })
}

// 查询月计划配送单详细
export function getDelivery(planId) {
  return request({
    url: '/sale/delivery/' + planId,
    method: 'get'
  })
}

// 新增月计划配送单
export function addDelivery(data) {
  return request({
    url: '/sale/delivery',
    method: 'post',
    data: data
  })
}

// 新增月计划配送单
export function addBatchWithDelivery(data) {
  return request({
    url: '/sale/delivery/save/batch',
    method: 'post',
    data: data
  })
}

// 修改月计划配送单
export function updateDelivery(data) {
  return request({
    url: '/sale/delivery',
    method: 'put',
    data: data
  })
}


// 审核月计划配送单
export function processDelivery(data) {
  return request({
    url: '/sale/delivery/process',
    method: 'put',
    data: data
  })
}

// 审核月计划配送单
export function processReverseDelivery(data) {
  return request({
    url: '/sale/delivery/reverse/process',
    method: 'put',
    data: data
  })
}


// 删除月计划配送单
export function delDelivery(ID) {
  return request({
    url: '/sale/delivery/' + ID,
    method: 'delete'
  })
}
